﻿@using MvcTemplates

@{
    object modelValue;
    if ( Model is System.Data.Linq.Binary )
    {
        modelValue = Convert.ToBase64String( ( ( System.Data.Linq.Binary ) Model ).ToArray() );
    }
    else if ( Model is byte[] )
    {
        modelValue = Convert.ToBase64String( ( byte[] ) Model );
    }
    else
    {
        modelValue = Model;
    }
}

@if ( !ViewData.ModelMetadata.HideSurroundingHtml ) {
    @ViewData.TemplateInfo.FormattedModelValue
}

@Html.Hidden( "", modelValue, ViewData.ModelMetadata.MergeAttributes<HtmlAttributesAttribute>(null) )